<template>
  <div id="app">
    <el-container>
      <el-header >
        <div class="left" ><i :class="titleClass" @click="showAslide"></i>合众开发平台</div>
        <div class="right">SM+Servlet+Vue+ElementUI+Maven+Git前后端分离</div>
      </el-header>
      <el-container>
        <el-aside :width="width">
          <el-menu
                  router
                  :default-active="$route.path"
                  class="el-menu-vertical-demo"
                  background-color="#545c64"
                  text-color="#fff"
                  active-text-color="#ffd04b">
            <el-submenu index="1">
              <template slot="title">
                <i class="el-icon-s-custom"></i>
                <span>学生管理</span>
              </template>
              <el-menu-item-group style="margin-left: 0em">
                <el-menu-item index="/student/list">
                  <i class="el-icon-menu"></i>
                  <span slot="title">学生列表</span>
                </el-menu-item>
              </el-menu-item-group>
            </el-submenu>
            <el-submenu index="2">
              <template slot="title">
                <i class="el-icon-location"></i>
                <span>班级管理</span>
              </template>
              <el-menu-item-group style="margin-left: 0em">
                <el-menu-item index="/classes/list">
                  <i class="el-icon-setting"></i>
                  <span slot="title">班级列表</span>
                </el-menu-item>
              </el-menu-item-group>
            </el-submenu>
          </el-menu>
        </el-aside>
        <el-main>
          <router-view/>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<style>
  *{
    padding:0;
    margin:0;
  }
  .el-menu{
    border:0 !important;
  }
  .el-header, .el-footer {
    background-color: rgb(84,92,100);
    color: white;
    line-height: 60px;
    padding:10px!important;
    padding-top: 0px!important;
  }
  .el-submenu{
    padding:0;
    margin:0;
  }
  .left{
    font-size:28px;
    font-family:华文行楷;
    color:lightgreen;
    margin-top: 5px;
    float:left;
  }
  .right{
    float:right
  }
  .el-aside {
    background-color: rgb(84,92,100);
    color: #333;
    text-align: left;
    height:600px;
  }

  .el-main {
    background-color: #E9EEF3;
    color: #333;
    text-align: center;
  }

</style>

<script>
  export default {
    data(){
      return {
        width: '180px',
        titleClass:'el-icon-s-fold',
        show: true,
      }
    },
    methods:{
      showAslide(){
        if(this.show){
          this.width = '0px'
          this.titleClass = 'el-icon-s-unfold'
          this.show = false
        }else{
          this.width = '180px'
          this.titleClass = 'el-icon-s-fold'
          this.show = true
        }

      }
    }
  }
</script>
